Displays a context message for the panel.

<div class="definition">
    message(panel, options);
</div>

<div class="arguments">
    <table>
    <tr>
        <td>panel</td>
        <td><b>string</b>, name of the panel</td>
    </tr>
    <tr>
        <td>options</td>
        <td><b>object</b>, message parameters</td>
    </tr>
    </table>
</div>

Returns <i>pormise</i> that is resolved when message is opened.

<h4>Description</h4>

Occasionally, you need to lock a panel and display a short message. The <span class="argument">message</span> method allows you to do just that. The method will slide an overlay at the top of the panel.
<div style="height: 10px"></div>

The second argument <span class="argument">options</span> is a map
of properties as follows:

<textarea class="javascript">
options: {
    html        : '',   // html of the message
    body        : '',   // similar to body in w2popup, can be used instead of options.html
    buttons     : '',   // similar to buttons in w2popup, can be used instead of options.html
    width       : 10,   // width in px (if negative, then it is 100% of popup in message.width)
    height      : 10,   // height in px (if negative, then it is 100% of popup in message.height)
    hideOnClick : true, // if true, hide message if user clicks on it
    onOpen      : null, // function to execute when message opens
    onClose     : null  // function to execute when message closes
}
</textarea>

To display the message
<textarea class="javascript">
w2ui.layout.message('main', 'some message')
    .then(event => {
        console.log('message is opened', event)
    })
    .ok(event => {
        console.log('ok clicked', event)
    })
</textarea>

Call it again to close the message
<textarea class="javascript">
w2ui.layout.message('main', {
        width: 500,
        height: 160,
        body: 'some message',
        buttons: '<button class="w2ui-btn">Ok</button>',
        onClose(event) {
            console.log('custom close')
        }
    })
    .then(event => {
        $(event.box).find('button').on('click', () => {
            w2ui.layout.message('main')
        })
        console.log('message is opened', event)
    })

</textarea>